Carbon


ActivatePalette

Header: Palettes.h Carbon status: Supported

Changes the device color tables and generates window updates as needed to meet the color requirements of your window.

void ActivatePalette (
    WindowRef srcWindow
);
Parameter descriptions
srcWindow

A pointer to the window for which you want status changes reported.

DISCUSSION

The Window Manager calls ActivatePalette when your window’s status changes—for example, when your window opens, closes, moves, or becomes frontmost. You need to call the ActivatePalette function yourself if you change a palette—for example, by changing a color with the SetEntryColor function—and you want the changes to take place immediately, before the Window Manager would do it.

If the window specified in the srcWindow parameter is frontmost, ActivatePalette examines the information stored in the window’s palette and attempts to provide the color environment described therein. It determines a list of devices on which to render the palette by intersecting the port rectangle of the window with each device. If the intersection is not empty and if the device has a color table, then ActivatePalette checks to see if the color environment is sufficient. If a change is required, ActivatePalette calls QuickDraw to reserve or modify the device’s color entries as needed. The ActivatePalette function then generates update events for all windows that need color updates.

Calling ActivatePalette with an offscreen graphics world has no effect.

AVAILABILITY

Supported in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 8.1 or later.


© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)